# Contributor: Aiden Grossman <agrossman154@yahoo.com>
# Maintainer: Aiden Grossman <agrossman154@yahoo.com>
pkgname=py3-xmlschema
pkgver=3.3.1
pkgrel=0
pkgdesc="XML schema validator and conversion library"
url="https://github.com/sissaschool/xmlschema"
arch="noarch"
license="MIT"
depends="py3-elementpath"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-jinja2"
options="net" # tests access xml.xsd from w3.org
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/sissaschool/xmlschema/archive/refs/tags/v$pkgver.tar.gz"
builddir="$srcdir/xmlschema-$pkgver/"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
42f852b6898fe855db7f0cf58ce5571a6e516d655f7970bbeeed929654774c02959416360dd0383670035a7ce727891d5e145a9da072c39a69361d2a11454252  py3-xmlschema-3.3.1.tar.gz
"
